// url 通过 location.href 获取
const url = `https://www.baidu.com/?aaa=1111&bbb=222&ccc=333`;

// 字符串解析
function urlParse(url) {
  let result = [];
  let _url = url.split('?')[1];
  _url = _url.split('&');
  _url.forEach((item) => {
    const _item = item.split('=');
    result.push({
      key: _item[0],
      value: _item[1],
    });
  });

  return result;
}

console.log(urlParse(url));
